#include "rsutransinitrsuonly.h"

void RsuTransInitRsuOnly::start()
{
    m_nCurrentStep=TS_INIT_RSU;
    m_pRsuCtrl->initRsu();
    m_pTransTimer->start(1500);
}

void RsuTransInitRsuOnly::processRsuFrame(quint8 nFrameIndex, quint8 nFrameType, const QByteArray &frame)
{
    Q_UNUSED(nFrameIndex);

    if (0xE0==nFrameType)
    {
        if (m_nCurrentStep==RsuTransInitRsuOnly::TS_INIT_RSU)
        {
            if (m_pRsuCtrl->processRsuInitFrame(frame))
            {
                m_pRsuCtrl->transToNormalTransStatus();
            }
            else
            {
                this->start();
            }
        }
        else
        {
            this->start();
        }
    }
    else
    {
        this->start();
    }
}
